"use strict";
//定义变量 
//基本数据类型 ：string number boolean null undefined  symbol
//ts any:任意的类型  元组 tuple  枚举 enum  void:没有类型  never：
//引用数据类型：array object
var str = 'hello';
var num = 1;
//联合类型  管道标识符
var pagenum = true;
var pagenum1 = null;
pagenum1 = undefined;
pagenum1 = 123;
//数组
//1.第一种：let 变量名:数据类型[] = []
// let arr:string[] = ['zs','lisi','lili'];
// let score:number[] = [90,80,70,20,0];
//2.第二种： let 变量名:Array<数据类型> = []
var arr = ['zs', 'lisi', 'lili'];
var score = [90, 80, 70, 20, 0];
var test = [true, false, true];
//定义元组 是数组的一种  规定了数组的每一个元素类型，和数组的长度 不能空格占位
var arr1 = ['zs', 18, true, null, undefined];
console.log(arr1[0]);
//数组里放置的是任意类型
var arr2 = [1, '2', true, 99, null, undefined];
//枚举 
/**
 * enum 变量名{  首字母大写
 *  枚举类型1=值1,
 *  枚举类型2=值2
 *  ...
 * }
 *
*/
//角色  讲师：1  学生:3  学委:2
var Role;
(function (Role) {
    Role[Role["teacher"] = 1] = "teacher";
    Role[Role["student"] = 3] = "student";
    Role[Role["team"] = 2] = "team";
})(Role || (Role = {}));
console.log(Role.student);
var Sex;
(function (Sex) {
    Sex[Sex["girl"] = 1] = "girl";
    Sex[Sex["boy"] = 2] = "boy";
    Sex[Sex["unkown"] = 3] = "unkown";
})(Sex || (Sex = {}));
var Week;
(function (Week) {
    Week[Week["monday"] = 0] = "monday";
    Week[Week["Tuesday"] = 1] = "Tuesday";
    Week[Week["Wednesday"] = 2] = "Wednesday"; //2
})(Week || (Week = {}));
//如果枚举没有给定值，默认值是从0开始
console.log(Week);
//void 常用：确定函数没有返回值
var name1 = undefined;
function registry() {
}
//never 常用在函数永远不会结束的返回值  了解
//返回“从不”的函数不能具有可访问的终结点
function ajax() {
    // throw new Error('请求失败')
    while (true) {
    }
}
//类型断言  封装路由表的时候会用
var type = 'lei xing duan yan';
//第一种：
var sub = type.substr(0, 1);
//第二种  常用
var sub1 = type.substr(0, 1);
// let obj = {
//     name:'lili',
//     age:18
// }
// obj = {
//     name:0,
//     age:'1'
// };
